package com.sl.proxy.server.dao.domain.entity;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sl.common.pojo.CommonEntity;
import com.sl.common.pojo.CommonOrgEntity;
import com.sl.proxy.server.constant.EnableStatusEnum;
import com.sl.proxy.server.constant.SecurityRulePassTypeEnum;
import com.sl.proxy.server.controller.res.system.SecurityGroupDetailRes;
import com.sl.proxy.server.controller.res.system.SecurityGroupListRes;
import jakarta.persistence.Entity;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.Date;

@Data
@ToString
@Accessors(chain = true)
@TableName("security_group")
@Entity(name = "security_group")
public class SecurityGroupDO extends CommonEntity {


    /**
     * 组名
     */
    private String name;

    /**
     * 描述
     */
    private String description;

    /**
     * 用户id
     */
    private String userId;
    /**
     * 启用状态
     * {@link EnableStatusEnum}
     */
    private Integer enable;

    /**
     * 默认放行类型
     * {@link SecurityRulePassTypeEnum}
     */
    private Integer defaultPassType;

    public SecurityGroupListRes toListRes() {
        SecurityGroupListRes res = new SecurityGroupListRes();
        BeanUtil.copyProperties(this, res);
        return res;
    }

    public SecurityGroupDetailRes toDetailRes() {
        SecurityGroupDetailRes res = new SecurityGroupDetailRes();
        BeanUtil.copyProperties(this, res);
        return res;
    }
}
